Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Custom Prometheus Exporterによる オブザーバビリティ拡張 / Ext...
Search
kohbis
May 10, 2025
Technology
310
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Custom Prometheus Exporterによる オブザーバビリティ拡張 / Extending observability with Custom Prometheus Exporter
大LT 2025 春 in Aizu
https://zli.connpass.com/event/351157/
kohbis
May 10, 2025
More Decks by kohbis
See All by kohbis
AIに丸投げしないトイル削減 / Eliminating Toil Without Leaving It All to AI
kohbis
4
1.1k
『家族アルバム みてね』における インシデント対応との向き合い方 / Approach incident response in Family Album
kohbis
2
490
Kubernetes環境周りの責任範囲をいい機会なので考える / Taking the Opportunity to Clarify Kubernetes Responsibilities
kohbis
2
460
『家族アルバム みてね』におけるAmazon EKSコストとの向き合い方 / Optimizing Amazon EKS Costs: The FamilyAlbum Case
kohbis
4
1.8k
潜在的課題探索活動の近況報告 / Exploration of latent challenges
kohbis
2
200
いま、あらためて考えてみるアカウント管理 with IaC / Account management with IaC
kohbis
3
1.2k
〜『世界中の家族のこころのインフラ』を目指して”次の10年”へ〜 SREが導いたグローバルサービスの信頼性向上戦略とその舞台裏 / Towards the Next Decade: Enhancing Global Service Reliability
kohbis
4
7.7k
Grafana MCP serverでなんかし隊 / Try Grafana MCP server
kohbis
0
1.1k
データベースで見る『家族アルバム みてね』の変遷 / The Evolution of Family Album Through the Lens of Databases
kohbis
5
1.6k
Other Decks in Technology
See All in Technology
銀行勘定系システムにおける開発プロセス刷新×AIによる環境モダナイゼーション / Development Process Transformation and AI-Driven Environment Modernization
muit
0
2.2k
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
1
530
20260912_スクラムにジェネラリストは必要か
ryugen04
0
420
なぜ「決定性」が 決定的に重要なのか? Durable Execution 基盤の数理的理解 #serverlessjp / ServerlessDays Tokyo 2026
ytaka23
0
140
安心して変更できるWebフロントエンドの作り方
pirosikick
4
2.6k
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
820
AI時代の「技術的負債」の変質ー概念の終焉と再解釈、エージェントと共に向かう先
nwiizo
0
2.6k
映像変換サーバーなしで端末内でHLSを生成してライブ配信
hikarusato
0
110
顧客に向き合う開発組織へ。リアーキテクチャとフィーチャーチーム化で挑む組織改革
safie
0
1.9k
AIエージェントの自己改善をどう設計するか / How to Design Self-Improvement for AI Agents
22mi
23
16k
CLIライブラリ開発を支える技術
htnabe
0
120
LTのテーマ どうきめてる?〜5つの型と私のやり方〜
yama3133
1
110
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Become a Pro
speakerdeck
PRO
31
6.3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Typedesign – Prime Four
hannesfritz
42
3.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Faster Mobile Websites
deanohume
310
32k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
Transcript
©MIXI Custom Prometheus Exporterによる オブザーバビリティ拡張 2025/05/10 大LT 2025 春 in
Aizu 株式会社MIXI みてね事業本部 みてねプラットフォーム部 SREグループ 杉本浩平
©MIXI 2 お話しすること • “オブザーバビリティ ” • Prometheus • Prometheus
Exporter • Custom Prometheus Exporterの実装
©MIXI 3 “オブザーバビリティ ” システムの出力を調査することによって内部の状態を測定する能力のこと ※1 4つの主要なデータタイプ( MELT) Metrics •
システムのパフォーマンスやリソース使用状況を定量的に示す数値データ Events • システム内で発生した特定の事象や状態変化を記録するデータ Logs • システムやアプリケーションの動作に関する詳細なテキスト記録 Traces • 分散システムにおけるリクエストの流れを追跡し、各サービス間のやり取りや処理時間を可視化するデー タ ※1 https://www.splunk.com/ja_jp/blog/devops/observability.html
©MIXI 4 Prometheus Prometheus collects and stores its metrics as
time series data. メトリクスを時系列データとして収集&保存する ※1 主なコンポーネント Prometheus Server • ターゲットからMetricsを収集して保存(他いろいろ) Service Discovery • ターゲットを自動的に検出 Exporter • システムやアプリケーションのMetricsをPrometheus Serverが収集できる形式で提供 Pushgateway • ライフサイクルが短いジョブからMetricsをプッシュ Alertmanager • Prometheus Serverから送信されるアラートを処理 ※1より引用 ※1 https://prometheus.io/docs/introduction/overview
©MIXI 5 Prometheus Exporter • いわゆる監視エージェントの役割 • 特定のシステムやアプリケーションをターゲットとし、メトリクスを収集し、 HTTPエンドポイントで公開 •
公式ドキュメントに記載されているだけでも200ほど • DBやクラウドサービスなど、あらゆるシステムやサービスに対応したPrometheus公式またはサードパーティ製 どのようなときに欲しくなる? 1. 利用しているソフトウェアがPrometheus形式のメトリクスを提供していない (例)MySQL server exporter, Redis exporter, 2. ホストマシンのシステムメトリクスを取得したい (例)Node/system metrics exporter, Windows exporter 3. ネットワーク機器や外部サービスを監視したい (例)SNMP exporter, Blackbox exporter 4. 独自アプリケーションやサービスを監視したい (例)クライアントライブラリで Expoterを自作 https://prometheus.io/docs/instrumenting/clientlibs/
©MIXI 6 Prometheusのメトリクス形式 1行目:# HELP メトリクスの説明文 2行目:# TYPE メトリクスの種類 3行目:メトリクス
この例では「HTTPメソッド x レスポンスコードごとのリクエスト数の変化を時系列的に追跡する」 ことが可能になる Prometheusのメトリクス形式でレスポンスを返却するエンドポイントを公開さえできれば ありとあらゆるシステムやアプリケーションの可視化や分析が可能になる
©MIXI 7 Custom Prometheus ExporterのRuby実装例(without client library) Prometheusのメトリクス形式の出力であればいい ので シンプルな実装でカスタムメトリクスを公開可能
1. メトリクスデータを Hash.new で初期化 2. ダミーデータを作成 • metrics += 1 で定期的に加算 3. webrickサーバーを起動 4. /metrics へのリクエストに、Prometheusのメトリクス形式のテ キストをレスポンス • # HELP を追加 • # TYPE を追加 • Hashのkey/valueを追加 ⬆ メトリクスの種類が増えただけ対応する必要がある
©MIXI 8 Custom Prometheus ExporterのRuby実装例(with client library) クライアントライブラリを使用すると簡単に作成可能 公式にはGo /
Java or Scala / Python / Ruby / Rustをサポート 1. Rubyのclientライブラリを使用 https://github.com/prometheus/client_ruby 2. レジストリを作成して、メトリクスを管理(in-memory) Counterメトリクスを定義 • GaugeやHistogramなどタイプがある https://prometheus.io/docs/concepts/metric_types 3. レジストリにCounterメトリクスを登録 4. ダミーデータを作成 • counter.increment で定期的に加算 5. webrickサーバーを起動 6. /metrics へのリクエストに、Prometheusのメトリクス形式のテ キストをレスポンス • クライアントライブラリが組み立ててくれる
©MIXI 9 業務で見ているもの(一部)
©MIXI “オブザーバビリティ ”に 思いを馳せてみるのもよいかも?
©MIXI